﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using CoreGallery.Addins.Contracts;

namespace CoreGallery.Core
{
    /// <summary>
    /// Represents a queued action to be undertaken by a plugin.
    /// Typically used when a UI captures choices from a user
    /// for a long-running action.  The plugin-specific state
    /// information is queued up by the Core then handed back for
    /// processing when time/priority allows it.
    /// </summary>
    public class CoreActionItem
    {
        ICoreAddinBase _plugin = null;
        ISerializable _state = null;
        int _progress = 0;

        CoreActionStatus _status = CoreActionStatus.NotStarted;

        public CoreActionItem(ICoreAddinBase plugin, ISerializable state)
        {
            _plugin = plugin;
            _state = state;
        }

        public ICoreAddinBase Plugin
        {
            get { return _plugin; }
        }

        public ISerializable State
        {
            get { return _state; }
            set { _state = value; }
        }

        public CoreActionStatus Status
        {
            get { return _status; }
            set { _status = value; }
        }

        public int Progress
        {
            get { return _progress; }
            set { _progress = value; }
        }
    }
}
